<?php
if(isset($_GET['action']) && $_GET['action']=="subscriber")
{
	include TEMPLATEPATH.'/mails/subscriber_template_mail.php';
	// xu ly truong hop dang ky nhan mail
	include TEMPLATEPATH.'/incs/subscriber/process.php';
	$email = $_GET['value'];
	$email = str_ireplace("00000", "@", $email);	
	if(db_check_exists_text('subscriber','email', $email))
	{
		echo 'Email is exists,are you want choose other email?';	
	}
	else 
	{
		if(db_subscriber_insert($email))
		{
			db_subscriber_send_email($email);
			echo 'Register email success full!';
		}
		else 
		{
			echo "Register email Failed,Send mail failed.";
		}
	}
}

?>